package com.gpf.pojo;

import java.io.Serializable;
import java.util.List;

import lombok.Data;

@Data
public class PageObject<T> implements Serializable{

	private static final long serialVersionUID = 873286778322106953L;
	//总记录数
	private Long rowCount=0L;//池化思想（用Long 而不是long）
	//当前页记录
	private List<T> records;
	//当前页的页码值
	private Integer pageCurrent=1;
	//页面大小
	private Integer pageSize=3;
	//总页数(通过计算获得)
	private Integer pageCount=0;

	public PageObject(){}

	public PageObject(Integer pageCurrent, Integer pageSize, Long rowCount, List<T> records) {
		super();
		this.pageCurrent = pageCurrent;
		this.pageSize = pageSize;
		this.rowCount = rowCount;
		this.records = records;
		this.pageCount=(int)(rowCount-1)/pageSize+1;
	}
}
